package com.boot.config;

import lombok.Data;
import lombok.ToString;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Data
@ToString
@Component
@PropertySource("classpath:jdbc.properties")
//如果不加 ConfigurationProperties 使用@Value来获取值
//@ConfigurationProperties(prefix = "mysql")
public class DBConfig {
    @Value("${mysql.driver}")
    private String driver;

    @Value("${mysql.url}")
    private String url;

    @Value("${mysql.userName}")
    private String userName;

    @Value("${mysql.password}")
    private String password;
}
